<?php
class page_base_securise extends page_base{

	public function deconnexion()
	{
		$_SESSION=array();
		session_destroy();
	
	}
	
	public function __construct($p) {
		parent::__construct($p);}
		
		
		
		
		
		
		
		
		
		/************** Affichage du nav de la page ***************************/
		private function affiche_nav() {
			
			?>
											<nav>
				<div class="wrap-nav zerogrid">
					<div class="menu">
					
						 <ul>
							<li><a href="index.php">Accueil</a>
							<li><a href="#.php">Materiel</a></li>
						  	<li><a href="eleve.php">Inscription Eleve</a></li>
						  	<li><a href="consultation.php">Consultation</a>
							<li><a href="contact.php">Contact</a>
							<li id='floatright'><a href="Deconnexion.php">Deconnexion</a>		
						</ul>	
					</div>
					
					
					<div class="minimenu"><div>MENU</div>
						<select onchange="location=this.value">
							<option></option>
							<option value="index.php">Accueil</option>
							<option value=#.php">Materiel</option>
							<option value="eleve.php">Inscription Eleve</option>
							<option value="consultation.php">Consultation</option>
							<option value="contact.php">Contact</option>
						</select>
					</div>		
					
				</div>
				
			</nav>
				<div id='NomCo'>	<?php echo('Connexion ecole  '.$_SESSION["NomE"]) ?>	</div>	            
							            
			<?php
		}
		
		
		
		public function SuppressionEleve()
		{
			
			try {
				$db = new MyPDO('mysql:host=localhost;dbname=usep_cq','CQ','usep49');
				$PrepREQ = new PreparationREQ($db);
				?>
					<section id='content'>
				<div class='wrap-content zerogrid'>
					<div class='row block01'>
						<div class='col-full'>
							<div class='wrap-col'>
							<article>
							<?php 
			
			$eleveasupprimer=$PrepREQ->Eleveasupprimer();
			
							} catch (Exception $e) {
								die("Impossible de se connecter: " . $e->getMessage());
							}
							
							?>
									</article>
									</div>
										</div>
									</div></div>
									</section><?php 
								}
			
		
		
		
	
		
		
	public function affiche_contenu()
	{
		try {
		$db = new MyPDO('mysql:host=localhost;dbname=usep_cq','CQ','usep49');
		$PrepREQ = new PreparationREQ($db);
		
		try {
		$eleve = $PrepREQ->eleveParEcole($_SESSION["NomE"]);
		$y='';
		$y=$y.'<br><br>';
		foreach ($eleve as $OneRow) { $y=$y.'&nbsp;'.$OneRow['NomEleve']."&nbsp;".$OneRow['PrenomEleve']."&nbsp;<b><a href='ModificationEleve.php'>Modifier</a>&nbsp;&nbsp;</b><b><a href='SuppressionEleve.php'>Supprimer</a></b><br>";}
		
		
		$y=$y."<br><br></table>";
		return $y;
		}catch (PDOException $e){print $e->getMessage();}
		
		} catch (Exception $e) {
			die("Impossible de se connecter: " . $e->getMessage());
		}
		

	}
		
		public function affiche() {
			?>
					<!DOCCTYPE html>
					<html lang='fr'>
						<head>
							<title>
								<?php $this->affiche_titre(); ?>
							</title>
							<meta charset="utf-8" /><link href='favicon.ico' rel='shortcut icon'/>
							<?php 
								$this->affiche_style(); 
								$this->affiche_js();
							?>
						</head>
						<header><?php 
								$this->affiche_header(); 
							?>
							
							</header>
							<nav><?php 
							
									$this->affiche_nav();
		
								
							?></nav>
						<body>
						
						<?php 
								$this->affiche_corps(); 
							?>
						
						
						
						</body>
						<footer><?php 
								utf8_encode($this->affiche_footer()); 
							?></footer>
							
					</html>
				<?php
			}
			
}

?>
			
			
			
			
			
			
			
			
			
			
            
            
		
		

